//
//  main.c
//  C_10进程与系统调用
//
//  Created by Robin on 16/3/20.
//  Copyright © 2016年 cnbm. All rights reserved.
//

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <errno.h>

char *now (){
    time_t t;
    time(&t);
    return asctime(localtime(&t));
}

void exec_test (){
    
    char *my_env[] = {"JUICE=peach an apple",NULL};
    execle("dinner_info", "dinner_info","4",NULL,my_env);
    puts("There must be some error!");
}

int main(int argc, const char * argv[]) {

    exec_test();
    
    //    char comment[80];
//    char cmd[120];
//
//    fgets(comment, 80, stdin);
//    
//    sprintf(cmd, "echo '%s %s' >> reports.log",comment,now());
//    
//    system(cmd);
    return 0;
}
